﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Main.Master" AutoEventWireup="true" CodeBehind="MyTasks.aspx.cs" Inherits="TimeManagementSystem.Tasks.MyTasks" %>
<%@ Import Namespace="TimeManagementSystem" %>
<%@ MasterType VirtualPath="~/Main.master" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <link rel="stylesheet" href="../Resources/css/MyTasks.css"/>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <div id="content">
        <div class="hTxt"><span class="firstLetter">M</span><span class="lastLetters">y Tasks</span></div>
        <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
        <asp:UpdatePanel runat="server">
            <ContentTemplate>
                <div id="selectDiv">
                    
                </div>
                <% var user = Master.GetCreatorUser();
                   var tasksCreatedByMe = Global.inputValid.dao.GetTasksCreatedByUser(user.Id);
                   var myTasks = Global.inputValid.dao.GetAllTasksAssignedToUser(user.Id); %>
                <table cellspacing="0">
                    <tr style="font-weight: bold; color: #8EBD00;">
                        <th style="text-align: center; width: 75px;">Number</th>
                        <th style="text-align: center; width: 75px;">Id</th>
                        <th>Goal</th>
                        <th>Task</th>
                        <th>Start date</th>
                        <th>Finish date</th>
                        <th>Priority</th>
                        <th>Status</th>
                    </tr>
                    <% for (var i = 0; i < myTasks.Count; i++)
                       { 
                           var clasees = i%2 == 0 ? "" : "odd";%>
                        <tr class="<%=clasees %> td">
                            <td class="taskNum"><%=(i+1)%></td>
                            <td class="taskId"><%=myTasks[i].Id%></td>
                            <td><%=myTasks[i].Goal %></td>
                            <td><%=myTasks[i].Name %></td>
                            <td><%=myTasks[i].StartDate.ToShortDateString() %></td>
                            <td><%=myTasks[i].FinishDate.ToShortDateString() %></td>
                            <td><%=myTasks[i].Priority %></td>
                            <td><%=myTasks[i].Status %></td>
                        </tr>
                    <% } %>
                </table>
            </ContentTemplate>
        </asp:UpdatePanel>
    </div>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder2" runat="server">
</asp:Content>
